<?php

namespace forfun\service;

use forfun\repository\ApiTokenRepository;
use forfun\repository\entity\ApiToken;

class ApiTokenService {
    /**
     * 通过access_token获取ApiToken实体.
     * @param $accessToken
     * @return ApiToken | null
     */
    public static function getByAccessToken($accessToken) {
        return ApiTokenRepository::instance()->findOne(array('access_token' => $accessToken));
    }
}